<!--
<div id="left">
	Categories
	<div class="new-item"><a href="<?php echo site_url('admin/newCategory'); ?>">Add Category</a></div>
	<ul>		
		<?php 
			//foreach($categories as $category)
			//{
			//	echo '<li>'.$category['category'].'</li>';
			//}
		?>
	</ul>
</div>
-->
<!--<div id="new_content">-->
	<h2><?php echo $product['name']  ?></h2>
	<?php echo form_open_multipart('admin/editProduct/'.$product['id']); ?>
	<table>
		<tr>
			<td>Product: </td>
			<td><input type="text" name="name" value="<?php echo $product['name']  ?>" size="20"/></td>
		</tr>
		<tr>
			<td>Category: </td>
			<td>
				<select name="category_id">
				<option value="0">--all--</option>
				<?php 
					foreach($categories as $category)
					{
				?>
					<option value="<?php echo $category['id']; ?>" <?php if($category['id'] == $product['category_id']) echo 'selected="selected"'; ?>><?php echo $category['category']; ?></option>
				<?php
					}
				?>
				</select>
			</td>
		</tr>
		<tr>
			<td>Thumbnail: </td>
			<td><input type="file" name="image" size="20"/></td>
		</tr>
		<?php 	
			if(isset($product['thumbnail']) && !empty($product['thumbnail']))
			{
		?>
		<tr>
			<td colspan="2">
				<image src="<?php echo base_url('upload/image/products/'.$product['thumbnail']); ?>" width="150px" height="150px">
			</td>
		</tr>
		<?php
			}
		?>
		<tr>
			<td>Image: </td>
			<td><input type="file" name="image" size="20"/></td>
		</tr>
		<?php 	
			if(isset($product['image']) && !empty($product['image']))
			{
		?>
		<tr>
			<td colspan="2">
				<image src="<?php echo base_url('upload/image/products/'.$product['image']); ?>" width="150px" height="150px">
			</td>
		</tr>
		<?php
			}
		?>
		<tr>
			<td>Image 1: </td>
			<td><input type="file" name="image1" size="20"/></td>
		</tr>
		<?php 	
			if(isset($product['image1']) && !empty($product['image1']))
			{
		?>
		<tr>
			<td colspan="2">
				<image src="<?php echo base_url('upload/image/products/'.$product['image1']); ?>" width="150px" height="150px">
			</td>
		</tr>
		<?php
			}
		?>
		<tr>
			<td>Image 2: </td>
			<td><input type="file" name="image2" size="20"/></td>
		</tr>
		<?php 	
			if(isset($product['image2']) && !empty($product['image2']))
			{
		?>
		<tr>
			<td colspan="2">
				<image src="<?php echo base_url('upload/image/products/'.$product['image2']); ?>" width="150px" height="150px">
			</td>
		</tr>
		<?php
			}
		?>
		<tr>
			<td>Image 3: </td>
			<td><input type="file" name="image3" size="20"/></td>
		</tr>
		<?php 	
			if(isset($product['image3']) && !empty($product['image3']))
			{
		?>
		<tr>
			<td colspan="2">
				<image src="<?php echo base_url('upload/image/products/'.$product['image3']); ?>" width="150px" height="150px">
			</td>
		</tr>
		<?php
			}
		?>
		<tr>
			<td>Image 4: </td>
			<td><input type="file" name="image4" size="20"/></td>
		</tr>
		<?php 	
			if(isset($product['image4']) && !empty($product['image4']))
			{
		?>
		<tr>
			<td colspan="2">
				<image src="<?php echo base_url('upload/image/products/'.$product['image4']); ?>" width="150px" height="150px">
			</td>
		</tr>
		<?php
			}
		?>
		<tr>
			<td>Price: </td>
			<td><input type="text" name="price" value="<?php echo $product['price']; ?>"/></td>
		</tr>
		<tr>
			<td>Quantity: </td>
			<td>
				<input type="text" name="quantity" value="<?php echo $product['quantity']; ?>" length="20">
			</td>
		</tr>
		<tr>
			<td>Origin: </td>
			<td>
				<input type="text" name="origin" value="<?php echo $product['origin']; ?>" length="20">
			</td>
		</tr>
		<tr>
			<td>Warranty: </td>
			<td>
				<input type="text" name="warranty" value="<?php echo $product['warranty']; ?>" length="20">
			</td>
		</tr>
		<tr>
			<td>Status: </td>
			<td>
				<input type="text" name="status" value="<?php echo $product['status']; ?>" length="20">
			</td>
		</tr>
		<tr>
			<td colspan="2">Description: </td>
		</tr>
		<tr>			
			<td colspan="2">
				<textarea cols="40" rows="10" name="desc" id="editor2">
					<?php echo $product['desc']; ?>
				</textarea>
			</td>
			<script type="text/javascript">
			//<![CDATA[

				CKEDITOR.replace( 'editor2',
					{
						fullPage : true,
						extraPlugins : 'docprops'
					});

			//]]>
			</script>
		</tr>
		<tr>
			<td colspan="2">Detail: </td>
		</tr>
		<tr>			
			<td colspan="2">
				<textarea cols="40" rows="10" name="detail" id="editor1">
					<?php echo $product['detail']; ?>
				</textarea>
			</td>
			<script type="text/javascript">
			//<![CDATA[

				CKEDITOR.replace( 'editor1',
					{
						fullPage : true,
						extraPlugins : 'docprops'
					});

			//]]>
			</script>
		</tr>
		<tr>
			<td>Products Related: </td>
			<td>
				<input type="text" name="product_relate" value="<?php echo $product['product_relate']; ?>" length="20">
			</td>
		</tr>		
		<tr>
			<td colspan="2" align="center">
				<input type="submit" name="submitBtn" value="Submit">
				<input type="reset" name="resetBtn" value="Reset">
			</td>
		</tr>
	</table>
	</form>
<!--</div>-->